package com.aaa.dang.modules.checkin.controller;

import com.aaa.dang.common.util.ResultModel;
import com.aaa.dang.modules.checkin.service.IPayment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author 刘旭泽
 * @version 1.0
 * @date 2018/12/20
 * @description
 */
@Controller
@RequestMapping("/payment")
public class Payment {

    @Autowired
   private IPayment service;

    /**
     * 跳转到交租管理界面
     *
     */
    @RequestMapping("/topayment")
    public String topayment(){
        return "checkIn/payment";
    }

    /**
     *@description  交租管理界面获取要展示的所有信息
     *@return com.aaa.dang.common.util.ResultModel
     *@param
     *@author 刘旭泽
     *@date 2018/12/20
     **/
    @RequestMapping("/getAllMsg")
    @ResponseBody
    public ResultModel getAllMsg(@RequestParam  Map<String,Object> query){
       ResultModel mod = service.getAllMsg(query);
       return mod;
    }
    /**
     *@description  把获取到的续租日期添加到数据库中
     *@return com.aaa.dang.common.util.ResultModel
     *@param
     *@author 刘旭泽
     *@date 2018/12/20
     **/
    @RequestMapping("/addDateForUser")
    @ResponseBody
    public ResultModel addDateForUser(@RequestParam Map<String,Object> query){
        ResultModel mod = service.addDateForUser(query);
        return mod;

    }
    /**
     *@description 查询所有历史记录
     *@return com.aaa.dang.common.util.ResultModel
     *@param
     *@author 刘旭泽
     *@date 2018/12/20
     **/
    @RequestMapping("/getAllHistory")
    @ResponseBody
    public ResultModel getAllHistory(@RequestParam Map<String,Object> query){
        ResultModel mod = service.getAllHistory(query);
        return mod;
    }




}
